# -*- coding: utf-8 -*-

import demo.cdn.common as common

def hotlink_protection():
    """
    示例
    """
    path = "v31/yjs/zones/5fb63643aca300429d044a43/settings/hotlink_protection"
    params = {}

    payload = {}
    payload['value'] = {"allowed_hostnames": ["*.baidu.com", "*.cloudflare.coms"], "status": "on"}

    headers = common.get_request_header(path, params, payload)

    url = common.OPENAPI_BASE_URL % path

    response = common.send_http_request("PATCH", url, params=params, payload=payload, headers=headers)


if __name__ == '__main__':
    hotlink_protection()
